a11y: Split out creation of cell info
authorBenjamin Otte <otte@redhat.com>
Mon, 24 Feb 2014 13:17:28 +0000 (14:17 +0100)
committerBenjamin Otte <otte@redhat.com>
Wed, 26 Feb 2014 01:36:07 +0000 (02:36 +0100)
Don't mix cell info creation with cell accessible creation. Instead,
first create the accessible, then create the cell info.

gtk/a11y/gtktreeviewaccessible.c

index b2b29f2759e44d08a763c0f82e9e80dd741b74ee..e8bd1d11a4031d42a6fe1c0db4490d51f800f64d 100644 (file)
@@ -362,8 +362,6 @@ peek_cell (GtkTreeViewAccessible *accessible,
 static GtkCellAccessible *
 create_cell_accessible (GtkTreeView           *treeview,
                         GtkTreeViewAccessible *accessible,
-                        GtkRBTree             *tree,
-                        GtkRBNode             *node,
                         GtkTreeViewColumn     *column)
 {
   GtkCellRenderer *renderer;
@@ -387,11 +385,6 @@ create_cell_accessible (GtkTreeView           *treeview,
       container_cell = GTK_CELL_ACCESSIBLE (container);
       _gtk_cell_accessible_initialize (container_cell, GTK_WIDGET (treeview), ATK_OBJECT (accessible));
 
-      /* The GtkTreeViewAccessibleCellInfo structure for the container will
-       * be before the ones for the cells so that the first one we find for
-       * a position will be for the container
-       */
-      cell_info_new (accessible, tree, node, column, container_cell);
       parent = ATK_OBJECT (container);
     }
   else
@@ -404,11 +397,6 @@ create_cell_accessible (GtkTreeView           *treeview,
       renderer = GTK_CELL_RENDERER (l->data);
 
       cell = GTK_CELL_ACCESSIBLE (gtk_renderer_cell_accessible_new (renderer));
-
-      /* Create the GtkTreeViewAccessibleCellInfo for this cell */
-      if (parent == ATK_OBJECT (accessible))
-        cell_info_new (accessible, tree, node, column, cell);
-
       _gtk_cell_accessible_initialize (cell, GTK_WIDGET (treeview), parent);
 
       if (container)
@@ -430,7 +418,8 @@ create_cell (GtkTreeView           *treeview,
 {
   GtkCellAccessible *cell;
 
-  cell = create_cell_accessible (treeview, accessible, tree, node, column);
+  cell = create_cell_accessible (treeview, accessible, column);
+  cell_info_new (accessible, tree, node, column, cell);
 
   set_cell_data (treeview, accessible, cell);
   _gtk_cell_accessible_update_cache (cell);